#include <stdio.h>
#include <stdlib.h>

int main(){
  int M = 0;
  int failed = 0;
  while(M++ < 50){
    char* ptr = (char*)malloc(10*1024*1024);
    memset(ptr, 0xFF, 10*1024*1024);
    if(!ptr){
      printf("allocate failed, retry %d.\n", ++failed);
      continue;
    }
    sprintf(ptr, "eat %d0 M\n", M);
    printf("%s", ptr);  
  }
  getchar();
  return 0;
}
